package net.mikoo.seals.agent.web.controller;

import javax.servlet.http.HttpServletRequest;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;

import net.mikoo.seals.agent.biz.services.MemberServices;
import net.mikoo.seals.agent.common.BaseController;
import net.mikoo.seals.agent.common.PageModel;
import net.mikoo.seals.agent.model.MemberQuery;
import net.mikoo.seals.agent.model.Party;

@Controller
@RequestMapping("/admin/member")
public class MemberController extends BaseController{

	
	Logger logger = LoggerFactory.getLogger(MemberController.class);
	
	@Autowired
	private MemberServices memberServices;
	
	@RequestMapping("/list")
	public String list(MemberQuery query, HttpServletRequest request, Model model) {
		
		PageModel<Party> pm =  memberServices.getToPageByQuery(query);
		model.addAttribute("pm", pm);
		
		return resultView(ADMIN_VIEW, "member/list");
	}
}
